<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>图书管理登录</title>
<link rel="stylesheet" href="css/login.css"/>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
</script>
<script type="text/javascript">
		$(document).ready(function(){
			$("button").mousedown(function(){
				login();
			});
		});

		function login(){
			var username = $("#user").val();
			var password = $("#pwd").val();

			$.ajax({
				type:"post",
				url:"./index_yanzheng.php",
				data:'username='+username+'&password='+password,
				success:function(msg){
						if(msg == "-1"){
							document.getElementById("error").innerHTML= "用户名或者密码不能为空";
						}else if(msg == "1"){
							window.location.href ='./teer.php';
						}else{
							document.getElementById("error").innerHTML= "用户名或者密码不正确";
						}
				}
				});
			};
</script>
</head>
<body>


<div class="title">Book</div>
 <div class = "boder">
            <div class = "top">用户登录</div>
     			
                    <div class="yonghuming">
                          用户名&nbsp;&nbsp;<input type="text" name="username" id="user" />
                    </div>
                    <div class="mima">
                    		密码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="pwd" type="password" name="password"/><br></br>
                          <span id="error"></span>
                    </div>
                    <div class="tijiao">
                   <button>提交</button>
                    <span id="error"></span>
                    </div>
                   
        

            
 </div>
 <div class="info">
		<ul>
        		<li style="float:left" >&nbsp;&nbsp;<a href="https://user.qzone.qq.com/1622629449?ptlang=2052&source=friendlist"><img src="img/QQ.png"/></a></li>
                
                <li style="float:left">&nbsp;&nbsp;<a href="https://github.com/JieFengBlog/studentSystem"><img src="img/github.png"/></a></li>
                
                <li style="float:left">&nbsp;&nbsp;<a href="https://jiefengblog.github.io/"><img src="img/blog.png"/></a></li>
        </ul>
 </div>
 
            
</body>
</html>
